home *** CD-ROM | disk | FTP | other *** search
/ Risc World 3 / Risc World 3.iso / SOFTWARE / ISSUE2 / PD / CAMPINS.ZIP / resources / returnline (.txt) < prev   
RISC OS BBC BASIC V Source  |  2002-05-29  |  1KB  |  67 lines

  1.  Returnline X V1.20 May 2002
  2.  Returnline [number] [path]
  3.  returns in system variable <Headline> the [number] line of text in file [path]
  4.  <rooturl> contains the root domain of the url for possible Referer use
  5.  By Stuart Halliday
  6.  buffer% 512  
  7.  "OS_GetEnv" 
  8.  command%
  9.     !command$=
  10. getstring(command%)
  11. 6command$=
  12. command$,
  13. (command$)-
  14. command$,""" ")-1)
  15.  command$="2 ADFS::HardDisc4.$.cURL.CamPins.resources.list2"
  16. command$,1)=
  17.  command$=
  18. command$,2)
  19. command$,1)=
  20.  command$=
  21. command$,
  22.  command$-1)
  23. ("UNSet Headline")
  24. position%=
  25. command$," ")
  26. "number%=
  27. command$,position%)
  28.  file$=
  29. command$,position%+1)
  30. file$=
  31. canonpath(file$)
  32.  PRINT file$
  33. "OS_File",5,file$ 
  34.  found%
  35.  found%<> 1 
  36. "OS_Find",&40,file$ 
  37.  handle%
  38. numloop%=1
  39.   line$=
  40. #handle%
  41.   numloop%+=1
  42.  numloop%>number% 
  43. #handle%
  44. #handle%
  45. (line$) =0 
  46.  line$="no line found"
  47. ("Set Headline "+line$)
  48.  PRINT ">>";line$;"<<"
  49. temp$=
  50. line$,8)
  51. temp$,"/")
  52. rooturl$=
  53. line$,P%+7)
  54. ("Set rooturl "+rooturl$)
  55. getstring(ptr%)
  56. 0    p$=""
  57.  (?ptr%>31 
  58.  ?ptr%<256) 
  59. (p$)<255
  60.   c%=?ptr%
  61.    IF c%>=97 AND c%<=122 THEN c%-=32
  62.   p$+=
  63.   ptr%+=1
  64. canonpath(path$)
  65. "OS_FSControl",37,path$,buffer%,0,0,512
  66. getstring(buffer%)
  67.